package com.jt.demo3;

import com.jt.demo3.config.SpringConfig;
import com.jt.demo3.porxy.JDKProxy;
import com.jt.demo3.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SpringTx {
    public static void main(String[] args) {
        ApplicationContext context=
                new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = context.getBean(UserService.class);
        userService.addUser();
        UserService proxy = (UserService) JDKProxy.getProxy(userService);
        userService.deleteUser();
        System.out.println("看看我牛逼了"+proxy);
    }
}
